$typeMap: (
    primary: $--link-primary-font-color,
    danger: $--link-danger-font-color,
    success: $--link-success-font-color,
    warning: $--link-warning-font-color,
    info: $--link-info-font-color,
);

.foxui-link {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    position: relative;
    text-decoration: none;
    outline: none;
    cursor: pointer;
    padding: 0;
    font-size: $--link-font-size;
    font-weight: $--link-font-weight;
    color: $--link-default-font-color;
    transition: 0.1s;

    &:not(.is-disabled) {
        &:hover {
            color: $--link-default-active-color;
        }

        &.has-underline {
            &:hover:after {
                content: '';
                position: absolute;
                left: 0;
                right: 0;
                height: 0;
                bottom: 0;
                border-bottom: $--border-width-base $--border-style-base $--link-default-active-color;
            }
        }
    }

    &.is-disabled {
        cursor: not-allowed;
        color: $--link-disabled-font-color;
    }

    @each $type, $color in $typeMap {
        &.foxui-link-#{$type} {
            color: $color;

            &:not(.is-disabled) {
                &:hover {
                    color: mix($color, $--color-white, 80%);
                }

                &.has-underline {
                    &:after {
                        border-color: mix($color, $--color-white, 80%);
                    }
                }
            }

            &.is-disabled {
                color: mix($color, $--color-white, 50%);
            }
        }
    }
}
